#!/usr/bin/python
# -*-coding:utf-8 -*-


def double_nine(right=True):
    desc_str = ''
    if right is False:
        for i in range(1, 10):
            for j in range(1, i + 1):
                temp_str = str(i * j)
                if j == 1:
                    pass
                elif int(temp_str) < 10:
                    temp_str = '  ' + temp_str
                elif int(temp_str) >= 10:
                    temp_str = ' ' + temp_str
                desc_str += temp_str
            desc_str += '\n'
        return desc_str
    else:
        for i in range(1, 10):
            for k in range(1, i):
                desc_str += '   '
            for j in range(i, 10):
                temp_str = str(i * j)
                if j == i:
                    if int(temp_str) >= 10:
                        desc_str = desc_str[:-1]
                elif int(temp_str) < 10:
                    temp_str = '  ' + temp_str
                elif int(temp_str) >= 10:
                    temp_str = ' ' + temp_str
                desc_str += temp_str
            desc_str += '\n'
        return desc_str


def duplicated_list(src_list):
    desc_dict = {}
    for index, value in enumerate(src_list):
        if value in desc_dict:
            desc_dict[value].append(index)
        else:
            desc_dict[value] = [index]
    desc_list = ['' for i in src_list]
    for key in desc_dict:
        if len(desc_dict[key]) == 1:
            pass
        else:
            for item in desc_dict[key]:
                desc_list[item] = key
    return [item for item in desc_list if item != '']
